<?php
namespace App\Services;

class TencentMap
{
	static $key = "HDSBZ-JOW3F-NNNJA-JAJKK-KJNQV-P2F6X";

	public static function coordiateToAddress($lnglat)
	{
		
		$url = "https://apis.map.qq.com/ws/geocoder/v1/?get_poi=0&location=".$lnglat."&key=".self::$key;

		$client = new \GuzzleHttp\Client();
		$res = $client->request('get',$url);
		$rs = json_decode($res->getBody()->getContents(),true);
		if($rs['status']==0){
			return $rs['result']['ad_info'];
		}
		return false;
		
	}
	
}
	
?>